package thread.lock.reentrallock;

import java.util.concurrent.locks.ReentrantLock;

/**
 * Created by mHandler on 2018/6/3 0003.
 * Description:
 */
public class MyService {
    private ReentrantLock lock = new ReentrantLock();

    public void testMethod(){
        lock.lock();
        for (int i = 0;i < 5; ++i){
            System.out.println(Thread.currentThread().getName() + (" " + (i + 1)));
        }
        lock.unlock();
    }

}
